home *** CD-ROM | disk | FTP | other *** search
/ Nintendo Holiday 2009-2010 / Nintendo Holiday.iso / mac / dyemagazine.swf / scripts / FFlippingBookSymbol.as < prev    next >
Text File  |  2009-10-24  |  70KB  |  2,085 lines

  1. function FFlippingBookConstants()
  2. {
  3.    this.DELIMITER = "%!!!%";
  4.    this.INVALID_XML_MSG = "FFlippingBookError: Incorrect XML source..";
  5.    this.MEDIA_INTERVAL = 300;
  6.    this.MEDIA_TIMEOUT = 3000;
  7.    this.PAGE_TIMEOUT = 3000;
  8.    this.DEF_PAGE_NAME = "fpage";
  9.    this.PAGE_SHADOW_LAYER_NAME = "shadows";
  10.    this.PAGE_BG_NAME = "bg";
  11.    this.PAGE_HOLDER_NAME = "holder";
  12.    this.PAGE_HOLDER_PARENT_NAME = "parent";
  13.    this.PAGE_PRELOADER_NAME = "loader";
  14.    this.PAGE_MEDIA_NAME = "media";
  15.    this.PAGE_MASK_NAME = "pmask";
  16.    this.SYMBOL_PRELOADER_NAME = "FFlippingBookLoaderSymbol";
  17.    this.PRELOADER_BAR_NAME = "bar_mc";
  18.    this.MAIN_OBJ_ID = "MAIN";
  19.    this.MODEL_OBJ_ID = "MODEL";
  20.    this.CACHE_OBJ_ID = "CACHE";
  21.    this.CONSTANTS_OBJ_ID = "CONSTANTS";
  22.    this.LOADER_OBJ_ID = "LOADER";
  23.    this.VIEW_OBJ_ID = "VIEW";
  24.    this.WIDTH_NODE_NAME = "WIDTH";
  25.    this.HEIGHT_NODE_NAME = "HEIGHT";
  26.    this.ALWAYS_OPENED_NODE_NAME = "ALWAYSOPENED";
  27.    this.SCALE_CONTENT_NODE_NAME = "SCALECONTENT";
  28.    this.AUTOFLIP_NODE_NAME = "AUTOFLIP";
  29.    this.FLIP_ON_CLICK_NODE_NAME = "FLIPONCLICK";
  30.    this.MOVE_SPEED_NODE_NAME = "MOVESPEED";
  31.    this.CLOSE_SPEED_NODE_NAME = "CLOSESPEED";
  32.    this.GOTO_SPEED_NODE_NAME = "GOTOSPEED";
  33.    this.FLIP_SOUND_NODE_NAME = "FLIPSOUND";
  34.    this.PAGE_BACK_NODE_NAME = "PAGEBACK";
  35.    this.LOAD_ON_DEMAND_NODE_NAME = "LOADONDEMAND";
  36.    this.CACHE_PAGES_NODE_NAME = "CACHEPAGES";
  37.    this.USE_PRELOADER_NODE_NAME = "USEPRELOADER";
  38.    this.PAGES_NODE_NAME = "PAGES";
  39.    this.FIRST_PAGE_NODE_NAME = "FIRSTPAGE";
  40.    this.SHADOWS_DEPTH_NODE_NAME = "SHADOWSDEPTH";
  41.    this.PAGE_STATIC_SHADOW1_NAME = "STATICSH1";
  42.    this.PAGE_STATIC_SHADOW2_NAME = "STATICSH2";
  43.    this.FLIP_SOUND_SYMBOL_NAME = "FFlippingBookSound";
  44.    this.NUM_TYPE_NAME = "number";
  45.    this.BOOL_TYPE_NAME = "boolean";
  46.    this.BOOL_TRUE_VAL = "TRUE";
  47.    this.BOOL_FALSE_VAL = "FALSE";
  48.    this.PRELOADER_WIDTH_SCALE = 2;
  49.    this.PRELOADER_HEIGHT_SCALE = 30;
  50.    this.MIN_PAGE_OFFSET = 0.9900000000000002;
  51.    this.MIN_PAGE_OFFSET2 = 0.9900000000000002;
  52.    this.DEF_WIDTH = 100;
  53.    this.DEF_HEIGHT = 100;
  54.    this.DEF_FIRST_PAGE = 0;
  55.    this.DEF_SHADOWS_DEPTH = 1;
  56.    this.DEF_MOVE_SPEED = 2;
  57.    this.DEF_CLOSE_SPEED = 3;
  58.    this.DEF_GOTO_SPEED = 3;
  59.    this.DEF_ALWAYS_OPENED = false;
  60.    this.DEF_FLIP_ON_CLICK = true;
  61.    this.DEF_LOAD_ON_DEMAND = true;
  62.    this.DEF_CACHE_PAGES = true;
  63.    this.DEF_USE_PRELOADER = true;
  64.    this.DEF_PAGEBACK = 11447982;
  65.    this.DEF_SCALE_CONTENT = true;
  66.    this.DEF_SOUND = "default";
  67.    this.DEF_NO_SOUND = "";
  68.    this.DEF_AUTOFLIP = 50;
  69.    this.EMPTY_PAGE = "_empty";
  70.    this.TRANSPARENT_PAGE1 = "_transp1";
  71.    this.TRANSPARENT_PAGE2 = "_transp2";
  72.    this.INIT_STATE = 0;
  73.    this.UNACTIVE_STATE = 1;
  74.    this.FLIPPING_STATE = 2;
  75.    this.FLIPOVER_STATE = 3;
  76.    this.FLIPBACK_STATE = 4;
  77.    this.AUTOFLIP_STATE = 5;
  78.    this.GOTOPAGE_STATE = 6;
  79.    this.CACHE_DEPTH = 100;
  80.    this.BOOK_DEPTH = 0;
  81.    this.PAGE_01_MC_NAME = "p01";
  82.    this.PAGE_02_MC_NAME = "p02";
  83.    this.PAGE_03_MC_NAME = "p03";
  84.    this.PAGE_04_MC_NAME = "p04";
  85.    this.MASK_03_MC_NAME = "m03";
  86.    this.MASK_12_MC_NAME = "m12";
  87.    this.SHADOW_03_MC_NAME = "s03";
  88.    this.SHADOW_04_MC_NAME = "s04";
  89.    this.SH_MASK_03_MC_NAME = "shm03";
  90.    this.SH_MASK_04_MC_NAME = "shm04";
  91.    this.PAGES_SH_MC_NAME = "s12";
  92.    this.PAGES_SHM_MC_NAME = "shm12";
  93.    this.STATIC_SHADOW_MC_NAME = "shStatic";
  94.    this.PAGE01_DEPTH = 8;
  95.    this.PAGE02_DEPTH = 5;
  96.    this.PAGE03_DEPTH = 4;
  97.    this.PAGE04_DEPTH = 0;
  98.    this.SH12_SCALE = 0.4;
  99.    this.SH3_SCALE = 1.6;
  100.    this.SPEED_DIV = 10;
  101. }
  102. function FFlippingBookBroker()
  103. {
  104.    this.objects = new Array();
  105. }
  106. function FFlippingBookCache(broker, usePreloader, cachePages, loadOnDemand, bgColor)
  107. {
  108.    this._broker = broker;
  109.    this._const = new FFlippingBookConstants();
  110.    this._broker.registerObject(this._const.CACHE_OBJ_ID,this);
  111.    this._baseObject = this._broker.objects[this._const.MAIN_OBJ_ID];
  112.    this._pagesDepth = this._const.CACHE_DEPTH;
  113.    this.usePreloader = usePreloader;
  114.    this.cachePages = cachePages;
  115.    this.loadOnDemand = loadOnDemand;
  116.    this.bgColor = bgColor;
  117.    this.__pagesLinks = new Array();
  118.    this.__pagesProcess = new Array();
  119.    this.__pagesHolders = new Array();
  120.    this.__pagesLoaders = new Array();
  121.    this.__pagesTimeouts = new Array();
  122.    this.__pagesLoading = new Array();
  123.    this.__pagesExt = new Array();
  124.    this.__pagesDepths = new Array();
  125.    this.__pagesBacks = new Array();
  126.    this.__pagesMasks = new Array();
  127.    this.__checkCompleted = new Array();
  128.    this.__pagesShadows1 = new Array();
  129.    this.__pagesShadows2 = new Array();
  130.    this._sound = new Sound(this._baseObject);
  131.    this._isSound = true;
  132.    this._soundTimeout = this._const.MEDIA_TIMEOUT;
  133.    this.sd = this._baseObject.shadowsDepth;
  134.    this._mediaComplete = false;
  135.    this._soundComplete = false;
  136.    this._pagesComplete = false;
  137.    this.extXML = new XML();
  138.    this.extXML.ignoreWhite = true;
  139.    this.extXML._parentObj = this;
  140.    this.extXML.onLoad = this.onXMLComplete;
  141. }
  142. function FFlippingBookModel(pagesSet, firstPage, alwaysOpened, broker)
  143. {
  144.    this._broker = broker;
  145.    this._const = new FFlippingBookConstants();
  146.    this._broker.registerObject(this._const.MODEL_OBJ_ID,this);
  147.    this._cache = this._broker.objects[this._const.CACHE_OBJ_ID];
  148.    this._baseObj = this._broker.objects[this._const.MAIN_OBJ_ID];
  149.    this._userPages = pagesSet;
  150.    this._curPageNumbers = new Array(4);
  151.    this._markEqual();
  152.    this._realPages = this._copyArray(pagesSet);
  153.    this.alwaysOpened = alwaysOpened;
  154.    this.__direction = -1;
  155.    this._makeItReal();
  156.    this.addProperty("_userCurrentPage2",this.getUserCurrentPage2,null);
  157.    this._userCurrentPage = firstPage;
  158.    this._currentPage = this._realPageNumber(firstPage);
  159. }
  160. function FFlippingBookClass()
  161. {
  162.    this._constants = new FFlippingBookConstants();
  163.    this._broker = new FFlippingBookBroker();
  164.    this._broker.registerObject(this._constants.MAIN_OBJ_ID,this);
  165.    this._cache = new FFlippingBookCache(this._broker,this.usePreloader,this.cachePages,this.loadOnDemand,this.pageBack);
  166.    this.addProperty("enabledProp",this.getEnabledProp,this.setEnabledProp);
  167.    this.addProperty("pagesNumberProp",this.getPagesNumberProp,null);
  168.    this.addProperty("autoFlipProp",this.getAutoFlipProp,this.setAutoFlipProp);
  169.    this.addProperty("flipOnClickProp",this.getFlipOnClick,this.setFlipOnClick);
  170.    this.addProperty("moveSpeedProp",this.getMoveSpeedProp,this.setMoveSpeedProp);
  171.    this.addProperty("closeSpeedProp",this.getCloseSpeedProp,this.setCloseSpeedProp);
  172.    this.addProperty("gotoSpeedProp",this.getGotoSpeedProp,this.setGotoSpeedProp);
  173.    this.addProperty("alwaysOpenedProp",this.getAlwaysOpenedProp,null);
  174.    this.EnabledProp = true;
  175.    this._a = Math.abs(this._rotation / 180 * 3.141592653589793);
  176.    this._sina = Math.sin(this._a);
  177.    this._cosa = Math.cos(this._a);
  178.    this._W = this._width;
  179.    this._H = this._height;
  180.    this._w = (this._H * this._sina - this._W * this._cosa) / (this._sina * this._sina - this._cosa * this._cosa);
  181.    this._h = (this._H * this._cosa - this._W * this._sina) / (this._cosa * this._cosa - this._sina * this._sina);
  182.    this.setSize(this._w,this._h);
  183.    this.box_mc._visible = false;
  184.    if(this.extXML != "")
  185.    {
  186.       this._cache.loadExternalXML(this.extXML);
  187.    }
  188.    else
  189.    {
  190.       this._getMedia();
  191.    }
  192. }
  193. function FFlippingBookView(bw, bh, autoFlip, flipOnClick, broker)
  194. {
  195.    this._const = new FFlippingBookConstants();
  196.    this._end = false;
  197.    this._broker = broker;
  198.    this._broker.registerObject(this._const.VIEW_OBJ_ID,this);
  199.    this._baseObj = this._broker.objects[this._const.MAIN_OBJ_ID];
  200.    this._cache = this._broker.objects[this._const.CACHE_OBJ_ID];
  201.    this._model = this._broker.objects[this._const.MODEL_OBJ_ID];
  202.    this._pageWidth = this._baseObj._bookWidth / 2;
  203.    this._pageHeight = this._baseObj._bookHeight;
  204.    this._autoFlip = this._baseObj.autoFlip;
  205.    this._flipOnClick = this._baseObj.flipOnClick;
  206.    this._pageSpeed = this._baseObj.moveSpeed / this._const.SPEED_DIV;
  207.    this._closeSpeed = this._baseObj.closeSpeed / this._const.SPEED_DIV;
  208.    this._gotoSpeed = this._baseObj.gotoSpeed / this._const.SPEED_DIV;
  209.    this._minOffset = this._const.MIN_PAGE_OFFSET;
  210.    this._flipSound = this._cache._sound;
  211.    this._bookState = this._const.INIT_STATE;
  212.    this._depth = this._const.BOOK_DEPTH;
  213.    this.radIndex = 57.29577951308232;
  214.    this._transpPage = 0;
  215.    this.__ox = 0;
  216.    this.__oy = 0;
  217.    this.__oldX = 0;
  218.    this.__oldY = 0;
  219.    this.__p4Empty = false;
  220.    this.__shadowHeight = 2 * Math.sqrt(this._pageHeight * this._pageHeight + this._pageWidth * this._pageWidth);
  221.    this.__pagesShadowHeight = 2 * Math.sqrt(4 * this._pageHeight * this._pageHeight + this._pageWidth * this._pageWidth);
  222.    this._radIndex = 57.29577951308232;
  223.    this.__gotoPageIndex = 0;
  224.    this.sd = this._baseObj.shadowsDepth;
  225.    this._drawBook();
  226.    this._baseObj.onMouseDown = this.__onMouseDown;
  227.    this._baseObj.onMouseUp = this.__onMouseUp;
  228.    this._baseObj.onEnterFrame = this.__onEnterFrame;
  229.    this._model.putPage();
  230. }
  231. FFlippingBookBroker.prototype.registerObject = function(id, obj)
  232. {
  233.    this.objects[id] = obj;
  234. };
  235. FFlippingBookCache.prototype._stripItem = function(str)
  236. {
  237.    var _loc2_ = str.indexOf(this._const.DELIMITER) + this._const.DELIMITER.length;
  238.    return str.substr(_loc2_);
  239. };
  240. FFlippingBookCache.prototype.loadExternalXML = function(src)
  241. {
  242.    if(src != "")
  243.    {
  244.       this.extXML.load(src);
  245.    }
  246.    else
  247.    {
  248.       this._baseObject._onXMLComplete(false);
  249.    }
  250. };
  251. FFlippingBookCache.prototype.onXMLComplete = function(success)
  252. {
  253.    if(success && this.status == 0)
  254.    {
  255.       this._parentObj._baseObject._onXMLComplete();
  256.    }
  257.    else if(this.status != 0)
  258.    {
  259.       trace(this._parentObj._const.INVALID_XML_MSG);
  260.    }
  261. };
  262. FFlippingBookCache.prototype.loadMedia = function(pagesSet, flipSound, pageBack, w, h)
  263. {
  264.    this._soundSrc = flipSound;
  265.    this._bgColor = pageBack;
  266.    this._realPages = pagesSet;
  267.    this._pageWidth = w / 2;
  268.    this._pageHeight = h;
  269.    this._loadFlipSound();
  270.    this._loadPages();
  271.    this._mediaInterval = setInterval(this.__checkMedia,this._const.MEDIA_INTERVAL,this);
  272. };
  273. FFlippingBookCache.prototype._loadFlipSound = function()
  274. {
  275.    this._soundComplete = false;
  276.    if(this._soundSrc == this._const.DEF_NO_SOUND)
  277.    {
  278.       this._isSound = false;
  279.       this._soundComplete = true;
  280.    }
  281.    else
  282.    {
  283.       this._sound.attachSound(this._soundSrc);
  284.       if(this._sound.duration == undefined)
  285.       {
  286.          this._sound.loadSound(this._soundSrc,false);
  287.       }
  288.       this._soundComplete = false;
  289.       this._isSound = false;
  290.    }
  291. };
  292. FFlippingBookCache.prototype.__checkMedia = function(obj)
  293. {
  294.    if(!obj._soundComplete)
  295.    {
  296.       if(obj._sound.getBytesLoaded() == obj._sound.getBytesTotal() || obj._sound.getBytesTotal() == undefined)
  297.       {
  298.          if(obj._sound.getBytesTotal == 0 && obj._soundTimeout > 0)
  299.          {
  300.             obj._soundTimeout -= obj._const.MEDIA_INTERVAL;
  301.          }
  302.          else if(obj._sound.getBytesTotal == undefined && obj._soundTimeout <= 0)
  303.          {
  304.             obj._isSound = false;
  305.             obj._soundComplete = true;
  306.          }
  307.          else
  308.          {
  309.             obj._isSound = true;
  310.             obj._soundComplete = true;
  311.          }
  312.       }
  313.    }
  314.    if(!obj._pagesComplete && !obj.loadOnDemand)
  315.    {
  316.       obj._pagesComplete = true;
  317.       for(src in obj.__pagesProcess)
  318.       {
  319.          if(obj.__pagesProcess[src] < 100 || obj.__checkCompleted[src] == 1 || isNaN(obj.__pagesProcess[src]))
  320.          {
  321.             var _loc2_ = obj.__pagesHolders[src].getBytesLoaded() / obj.__pagesHolders[src].getBytesTotal() * 100;
  322.             if(obj.usePreloader)
  323.             {
  324.                obj.__pagesLoaders[src]._xscale = _loc2_;
  325.             }
  326.             obj.__pagesProcess[src] = _loc2_;
  327.             obj.__pagesTimeouts[src] -= obj._const.MEDIA_INTERVAL;
  328.             if(_loc2_ == 100 && obj.__pagesHolders[src].getBytesLoaded() > 4 && obj.__checkCompleted[src] == 1)
  329.             {
  330.                obj.__pagesLoaders[src]._parent.removeMovieClip();
  331.                obj.__pagesHolders[src]._width = obj._pageWidth;
  332.                obj.__pagesHolders[src]._height = obj._pageHeight;
  333.                obj.__pagesHolders[src]._parent._visible = true;
  334.                obj.__pagesProcess[src] = _loc2_;
  335.                if(obj._model == undefined)
  336.                {
  337.                   obj._model = obj._broker.objects[obj._const.MODEL_OBJ_ID];
  338.                }
  339.                obj._baseObject.onPageLoad(obj._stripItem(src));
  340.             }
  341.             else
  342.             {
  343.                obj._pagesComplete = false;
  344.             }
  345.             if(_loc2_ == 100 && obj.__pagesHolders[src].getBytesLoaded() > 4)
  346.             {
  347.                obj.__checkCompleted[src] = 1;
  348.             }
  349.          }
  350.       }
  351.    }
  352.    if(obj._soundComplete && (obj._pagesComplete || obj.loadOnDemand))
  353.    {
  354.       clearInterval(obj._mediaInterval);
  355.       obj._baseObject._onMediaComplete();
  356.    }
  357. };
  358. FFlippingBookCache.prototype._loadPages = function()
  359. {
  360.    var k = this._realPages.length;
  361.    var i = 0;
  362.    while(i < k)
  363.    {
  364.       if(this.__pagesLinks[this._realPages[i]] == undefined)
  365.       {
  366.          this.__pagesLinks[this._realPages[i]] = this.__createPage(this._const.DEF_PAGE_NAME + "_" + i,this._realPages[i]);
  367.          this.__pagesLinks[this._realPages[i]]._x = i * (this._pageWidth + 2);
  368.          this.__pagesLinks[this._realPages[i]]._visible = false;
  369.       }
  370.       i++;
  371.    }
  372.    for(src in this.__pagesLinks)
  373.    {
  374.       this.__pagesLoading[src] = false;
  375.       var media = this.__pagesHolders[src].attachMovie(this._stripItem(src),this._const.PAGE_MEDIA_NAME,0);
  376.       if(media == undefined && src != this._const.TRANSPARENT_PAGE1 && src != this._const.TRANSPARENT_PAGE2 && src != this._const.EMPTY_PAGE)
  377.       {
  378.          this.__pagesProcess[src] = 0;
  379.          this.__pagesExt[src] = true;
  380.          this.__pagesTimeouts[src] = this._const.PAGE_TIMEOUT;
  381.          if(!this.loadOnDemand)
  382.          {
  383.             this.__pagesHolders[src]._parent._visible = false;
  384.             this.__pagesHolders[src].loadMovie(this._stripItem(src));
  385.          }
  386.          if(this.usePreloader)
  387.          {
  388.             var loaderLnk = this.__pagesLinks[src];
  389.             this.__placePreloader(loaderLnk);
  390.             this.__pagesLoaders[src] = eval(loaderLnk + "." + this._const.PAGE_PRELOADER_NAME + "." + this._const.PRELOADER_BAR_NAME);
  391.          }
  392.       }
  393.       else
  394.       {
  395.          this.__pagesExt[src] = false;
  396.          this.__pagesProcess[src] = 100;
  397.          if(this._baseObject.scaleContent)
  398.          {
  399.             this.__pagesHolders[src]._width = this._pageWidth;
  400.             this.__pagesHolders[src]._height = this._pageHeight;
  401.          }
  402.          else
  403.          {
  404.             this.__pagesHolders[src].setMask(this.__pagesMasks[src]);
  405.          }
  406.       }
  407.    }
  408. };
  409. FFlippingBookCache.prototype.__createPage = function(src, id)
  410. {
  411.    var _loc3_ = this._baseObject.createEmptyMovieClip(src,this._pagesDepth++);
  412.    var _loc4_ = _loc3_.createEmptyMovieClip(this._const.PAGE_HOLDER_PARENT_NAME,1);
  413.    if(id != this._const.TRANSPARENT_PAGE1 && id != this._const.TRANSPARENT_PAGE2)
  414.    {
  415.       var _loc5_ = _loc3_.createEmptyMovieClip(this._const.PAGE_BG_NAME,0);
  416.       var _loc6_ = _loc3_.createEmptyMovieClip(this._const.PAGE_SHADOW_LAYER_NAME,100);
  417.       this.__drawBack(_loc5_);
  418.       this.__pagesBacks[id] = _loc5_;
  419.       if(id != this._const.EMPTY_PAGE)
  420.       {
  421.          this.__pagesHolders[id] = _loc4_.createEmptyMovieClip(this._const.PAGE_HOLDER_NAME,0);
  422.          this.__pagesProcess[id] = 0;
  423.          if(!this._baseObject.scaleContent)
  424.          {
  425.             this.__pagesMasks[id] = _loc4_.createEmptyMovieClip(this._const.PAGE_MASK_NAME,100);
  426.             this.__drawBack(this.__pagesMasks[id]);
  427.          }
  428.       }
  429.       else
  430.       {
  431.          this.__pagesProcess[id] = 100;
  432.       }
  433.       var _loc0_ = null;
  434.       var _loc8_ = this.__pagesShadows1[id] = _loc6_.createEmptyMovieClip(this._const.PAGE_STATIC_SHADOW1_NAME,10);
  435.       var _loc0_ = null;
  436.       var _loc7_ = this.__pagesShadows2[id] = _loc6_.createEmptyMovieClip(this._const.PAGE_STATIC_SHADOW2_NAME,11);
  437.       this.__drawStaticShadows(_loc8_,_loc7_);
  438.    }
  439.    else
  440.    {
  441.       this.__pagesHolders[id] = 100;
  442.    }
  443.    return _loc3_;
  444. };
  445. FFlippingBookCache.prototype.__drawStaticShadows = function(mc1, mc2)
  446. {
  447.    var pw = this._pageWidth;
  448.    var sw = pw / 3;
  449.    var sh = this._pageHeight;
  450.    var colors = [0,0];
  451.    var ratios = [0,255];
  452.    var alphas = [0,20 * this.sd];
  453.    var matrix = {matrixType:"box",x:pw - sw,y:0,w:sw,h:sh,r:0};
  454.    with(mc1)
  455.    {
  456.       moveTo(pw - sw,0);
  457.       beginGradientFill("linear",colors,alphas,ratios,matrix);
  458.       lineTo(pw,0);
  459.       lineTo(pw,sh);
  460.       lineTo(pw - sw,sh);
  461.       lineTo(pw - sw,0);
  462.       endFill();
  463.    }
  464.    colors = [0,0];
  465.    ratios = [0,255];
  466.    alphas = [20 * this.sd,0];
  467.    matrix = {matrixType:"box",x:0,y:0,w:sw,h:sh,r:0};
  468.    with(mc2)
  469.    {
  470.       moveTo(0,0);
  471.       beginGradientFill("linear",colors,alphas,ratios,matrix);
  472.       lineTo(sw,0);
  473.       lineTo(sw,sh);
  474.       lineTo(0,sh);
  475.       lineTo(0,0);
  476.       endFill();
  477.    }
  478. };
  479. FFlippingBookCache.prototype.__placePreloader = function(mc)
  480. {
  481.    var _loc2_ = mc.attachMovie(this._const.SYMBOL_PRELOADER_NAME,this._const.PAGE_PRELOADER_NAME,2);
  482.    var _loc4_ = this._pageWidth / 2;
  483.    var _loc3_ = this._pageHeight / 2;
  484.    _loc2_._width = this._pageWidth / this._const.PRELOADER_WIDTH_SCALE;
  485.    _loc2_._height = this._pageHeight / this._const.PRELOADER_HEIGHT_SCALE;
  486.    _loc2_._x = _loc4_ - _loc2_._width / 2;
  487.    _loc2_._y = _loc3_ - _loc2_._height / 2;
  488.    _loc2_.bar_mc._xscale = 0;
  489. };
  490. FFlippingBookCache.prototype.__drawBack = function(mc)
  491. {
  492.    trace(mc);
  493.    with(mc)
  494.    {
  495.       moveTo(0,0);
  496.       beginFill(this.bgColor,100);
  497.       lineTo(this._pageWidth,0);
  498.       lineTo(this._pageWidth,this._pageHeight);
  499.       lineTo(0,this._pageHeight);
  500.       lineTo(0,0);
  501.       endFill();
  502.    }
  503. };
  504. FFlippingBookCache.prototype.getPage = function(src)
  505. {
  506.    var _loc3_ = this.__pagesLinks[src];
  507.    if(!this.loadOnDemand)
  508.    {
  509.       return _loc3_;
  510.    }
  511.    if(this.__pagesProcess[src] == 0 || !this.cachePages && this.__pagesExt[src] && this.__pagesProcess[src] == 100)
  512.    {
  513.       this.__pagesTimeouts[src] = this._const.PAGE_TIMEOUT;
  514.       this.__pagesHolders[src]._parent._visible = false;
  515.       this.__pagesHolders[src].loadMovie(this._stripItem(src));
  516.       this.__pagesLoading[src] = true;
  517.       if(!this.cachePages)
  518.       {
  519.          this.__pagesLoaders[src]._parent._visible = true;
  520.       }
  521.       if(this._pagesInterval == undefined)
  522.       {
  523.          this._pagesInterval = setInterval(this.__checkPages,this._const.MEDIA_INTERVAL,this);
  524.       }
  525.    }
  526.    return _loc3_;
  527. };
  528. FFlippingBookCache.prototype.__checkPages = function(obj)
  529. {
  530.    var _loc3_ = true;
  531.    for(src in obj.__pagesLoading)
  532.    {
  533.       if(obj.__pagesLoading[src])
  534.       {
  535.          var _loc2_ = obj.__pagesHolders[src].getBytesLoaded() / obj.__pagesHolders[src].getBytesTotal() * 100;
  536.          if(obj.usePreloader)
  537.          {
  538.             obj.__pagesLoaders[src]._xscale = _loc2_;
  539.          }
  540.          obj.__pagesTimeouts[src] -= obj._const.MEDIA_INTERVAL;
  541.          obj.__pagesProcess[src] = _loc2_;
  542.          if(_loc2_ == 100 && obj.__pagesHolders[src].getBytesLoaded() > 4 && obj.__checkCompleted[src] == 1 && !isNaN(_loc2_))
  543.          {
  544.             if(obj.cachePages)
  545.             {
  546.                obj.__pagesLoaders[src]._parent.removeMovieClip();
  547.                obj.__pagesProcess[src] = 100;
  548.             }
  549.             else
  550.             {
  551.                obj.__pagesLoaders[src]._parent._visible = false;
  552.                obj.__pagesLoaders[src]._xscale = 0;
  553.                obj.__checkCompleted[src] = undefined;
  554.             }
  555.             if(obj._baseObject.scaleContent)
  556.             {
  557.                obj.__pagesHolders[src]._width = obj._pageWidth;
  558.                obj.__pagesHolders[src]._height = obj._pageHeight;
  559.             }
  560.             else
  561.             {
  562.                obj.__pagesHolders[src].setMask(obj.__pagesMasks[src]);
  563.             }
  564.             obj.__pagesHolders[src]._parent._visible = true;
  565.             obj.__pagesLoading[src] = false;
  566.             if(obj._model == undefined)
  567.             {
  568.                obj._model = obj._broker.objects[obj._const.MODEL_OBJ_ID];
  569.             }
  570.             obj._baseObject.onPageLoad(obj._stripItem(src));
  571.          }
  572.          else
  573.          {
  574.             _loc3_ = false;
  575.          }
  576.          if(_loc2_ == 100 && obj.__pagesHolders[src].getBytesLoaded() > 4)
  577.          {
  578.             obj.__checkCompleted[src] = 1;
  579.          }
  580.       }
  581.    }
  582.    if(_loc3_)
  583.    {
  584.       clearInterval(obj._pagesInterval);
  585.       obj._pagesInterval = undefined;
  586.    }
  587. };
  588. FFlippingBookCache.prototype.setPage = function(page, src, i, pageNum, dir)
  589. {
  590.    if(this._baseObject.loadOnDemand)
  591.    {
  592.       if(i == 1 || i == 3)
  593.       {
  594.          var _loc12_ = 4;
  595.          var _loc2_ = new Array();
  596.          var _loc4_ = new Array();
  597.          var _loc3_ = 0;
  598.          while(_loc3_ < _loc12_)
  599.          {
  600.             if(dir == 1)
  601.             {
  602.                _loc2_[_loc3_] = pageNum + _loc3_ + 2;
  603.                _loc4_[_loc3_] = pageNum - _loc3_ - 3;
  604.             }
  605.             else if(dir == -1)
  606.             {
  607.                _loc2_[2 * _loc3_] = pageNum + _loc3_ + 2;
  608.                _loc2_[2 * _loc3_ + 1] = pageNum - _loc3_ - 1;
  609.             }
  610.             else
  611.             {
  612.                _loc2_[_loc3_] = pageNum - _loc3_ - 1;
  613.                _loc4_[_loc3_] = pageNum + _loc3_ + 4;
  614.             }
  615.             _loc3_ = _loc3_ + 1;
  616.          }
  617.          var _loc9_ = this._baseObject._model._realPages.length;
  618.          _loc3_ = 0;
  619.          while(_loc3_ < _loc2_.length)
  620.          {
  621.             if(_loc2_[_loc3_] > 0 && _loc2_[_loc3_] < _loc9_)
  622.             {
  623.                var _loc6_ = this._baseObject._model._realPages[_loc2_[_loc3_]];
  624.                if(this.__pagesExt[_loc6_] && this.__pagesProcess[_loc6_] == 0)
  625.                {
  626.                   this.getPage(_loc6_);
  627.                }
  628.             }
  629.             _loc3_ = _loc3_ + 1;
  630.          }
  631.          _loc3_ = 0;
  632.          while(_loc3_ < _loc4_.length)
  633.          {
  634.             if(_loc4_[_loc3_] > 0 && _loc4_[_loc3_] < _loc9_)
  635.             {
  636.                _loc6_ = this._baseObject._model._realPages[_loc4_[_loc3_]];
  637.                if(this.__pagesExt[_loc6_] && this.__pagesProcess[_loc6_] != 0 && i == 1)
  638.                {
  639.                   this.__pagesProcess[_loc6_] = 0;
  640.                   unloadMovie(this.__pagesHolders[_loc6_]);
  641.                }
  642.             }
  643.             _loc3_ = _loc3_ + 1;
  644.          }
  645.       }
  646.    }
  647.    if(this._view == undefined)
  648.    {
  649.       this._view = this._broker.objects[this._const.VIEW_OBJ_ID];
  650.    }
  651.    var _loc10_ = this.getPage(src);
  652.    var _loc13_ = page;
  653.    this.__pagesDepths[i] = _loc10_.getDepth();
  654.    _loc13_.swapDepths(_loc10_);
  655.    _loc10_._x = _loc13_._x;
  656.    _loc10_._y = _loc13_._y;
  657.    _loc10_._rotation = _loc13_._rotation;
  658.    _loc13_._visible = false;
  659.    if(i < 3)
  660.    {
  661.       _loc10_._visible = true;
  662.    }
  663.    if((i == 1 || i == 2) && (src == this._const.TRANSPARENT_PAGE1 || src == this._const.TRANSPARENT_PAGE2))
  664.    {
  665.       this._view._transpPage = i;
  666.    }
  667.    if(i == 4 && (src == this._const.TRANSPARENT_PAGE1 || src == this._const.TRANSPARENT_PAGE2))
  668.    {
  669.       this._view._transpPage04 = true;
  670.    }
  671.    else
  672.    {
  673.       this._view._transpPage04 = false;
  674.    }
  675.    switch(i)
  676.    {
  677.       case 1:
  678.          this._view.__page01 = _loc10_;
  679.          this.__pagesShadows1[src]._visible = true;
  680.          this.__pagesShadows2[src]._visible = false;
  681.          break;
  682.       case 2:
  683.          this._view.__page02 = _loc10_;
  684.          this.__pagesShadows1[src]._visible = false;
  685.          this.__pagesShadows2[src]._visible = true;
  686.          break;
  687.       case 3:
  688.          this._view.__page03 = _loc10_;
  689.          if(this._view.__ox > 0)
  690.          {
  691.             this.__pagesShadows1[src]._visible = true;
  692.             this.__pagesShadows2[src]._visible = false;
  693.          }
  694.          else
  695.          {
  696.             this.__pagesShadows1[src]._visible = false;
  697.             this.__pagesShadows2[src]._visible = true;
  698.          }
  699.          break;
  700.       case 4:
  701.          this._view.__page04 = _loc10_;
  702.          if(this._view.__ox < 0)
  703.          {
  704.             this.__pagesShadows1[src]._visible = true;
  705.             this.__pagesShadows2[src]._visible = false;
  706.          }
  707.          else
  708.          {
  709.             this.__pagesShadows1[src]._visible = false;
  710.             this.__pagesShadows2[src]._visible = true;
  711.          }
  712.    }
  713. };
  714. FFlippingBookCache.prototype.setSize = function(w, h)
  715. {
  716.    for(link in this.__pagesLinks)
  717.    {
  718.       this.__pagesLinks[link]._width = w / 2;
  719.       this.__pagesLinks[link]._height = h;
  720.    }
  721. };
  722. FFlippingBookCache.prototype.restoreDirectGotoPages = function()
  723. {
  724.    this._view.__page01.setMask(null);
  725.    this._view.__page02.setMask(null);
  726.    this._view.__mask12.clear();
  727.    this._view.__page01._visible = false;
  728.    this._view.__page02._visible = false;
  729.    this._view.__page01.swapDepths(this.__pagesDepths[1]);
  730.    this._view.__page02.swapDepths(this.__pagesDepths[2]);
  731.    this._view.__page01 = this._view.tmp01;
  732.    this._view.__page02 = this._view.tmp02;
  733.    this._view._transpPage = 0;
  734. };
  735. FFlippingBookCache.prototype.restorePages = function()
  736. {
  737.    this._view.__page01.setMask(null);
  738.    this._view.__page02.setMask(null);
  739.    this._view.__page03.setMask(null);
  740.    this._view.__page04.setMask(null);
  741.    this._view.__mask03.clear();
  742.    this._view.__mask12.clear();
  743.    this._view.__page01._visible = false;
  744.    this._view.__page02._visible = false;
  745.    this._view.__page01.swapDepths(this.__pagesDepths[1]);
  746.    this._view.__page02.swapDepths(this.__pagesDepths[2]);
  747.    this._view.__page03.swapDepths(this.__pagesDepths[3]);
  748.    this._view.__page04.swapDepths(this.__pagesDepths[4]);
  749.    this._view.__page03._x = - this._view._pageWidth;
  750.    this._view.__page03._y = (- this._view._pageHeight) / 2;
  751.    this._view.__page03._rotation = 0;
  752.    this._view.__page04._x = 0;
  753.    this._view.__page04._y = (- this._view._pageHeight) / 2;
  754.    this._view.__page04._rotation = 0;
  755.    this._view.__page01 = this._view.tmp01;
  756.    this._view.__page02 = this._view.tmp02;
  757.    this._view.__page03 = this._view.tmp03;
  758.    this._view.__page04 = this._view.tmp04;
  759.    this._view._transpPage = 0;
  760. };
  761. FFlippingBookCache.prototype.restoreWorkPages = function()
  762. {
  763.    this._view.__page01.setMask(null);
  764.    this._view.__page02.setMask(null);
  765.    this._view.__mask03.clear();
  766.    this._view.__mask12.clear();
  767.    this._view._drawShadow12();
  768.    this._view._drawShadow03();
  769.    this._view._drawShadow04();
  770.    this._view.__page03._visible = false;
  771.    this._view.__page04._visible = false;
  772.    this._view.__page03.swapDepths(this.__pagesDepths[3]);
  773.    this._view.__page04.swapDepths(this.__pagesDepths[4]);
  774.    this._view.__page03._x = - this._view._pageWidth;
  775.    this._view.__page03._y = (- this._view._pageHeight) / 2;
  776.    this._view.__page03._rotation = 0;
  777.    this._view.__page04._x = 0;
  778.    this._view.__page04._y = (- this._view._pageHeight) / 2;
  779.    this._view.__page04._rotation = 0;
  780.    this._view.__page03 = this._view.tmp03;
  781.    this._view.__page04 = this._view.tmp04;
  782. };
  783. FFlippingBookModel.prototype.getUserPageNumber = function(src)
  784. {
  785.    var _loc4_ = this._userPages.length;
  786.    var _loc2_ = 0;
  787.    while(_loc2_ < _loc4_)
  788.    {
  789.       var _loc3_ = this._userPages[_loc2_];
  790.       if(_loc3_ == src)
  791.       {
  792.          return _loc2_;
  793.       }
  794.       _loc2_ = _loc2_ + 1;
  795.    }
  796. };
  797. FFlippingBookModel.prototype._markEqual = function()
  798. {
  799.    var _loc10_ = this._const.DELIMITER;
  800.    var _loc7_ = this._userPages.length;
  801.    var _loc5_ = new Array(_loc7_);
  802.    var _loc6_ = 0;
  803.    while(_loc6_ < _loc7_)
  804.    {
  805.       _loc5_[_loc6_] = false;
  806.       _loc6_ = _loc6_ + 1;
  807.    }
  808.    var _loc4_ = 0;
  809.    while(_loc4_ < _loc7_)
  810.    {
  811.       var _loc9_ = this._userPages[_loc4_];
  812.       var _loc11_ = _loc4_;
  813.       var _loc8_ = 0;
  814.       var _loc2_ = 0;
  815.       while(_loc2_ < _loc7_)
  816.       {
  817.          var _loc3_ = this._userPages[_loc2_];
  818.          if(_loc3_ == _loc9_ && !_loc5_[_loc2_])
  819.          {
  820.             _loc8_;
  821.             this._userPages[_loc2_] = _loc8_++ + _loc10_ + this._userPages[_loc2_];
  822.             _loc5_[_loc2_] = true;
  823.          }
  824.          _loc2_ = _loc2_ + 1;
  825.       }
  826.       _loc4_ = _loc4_ + 1;
  827.    }
  828. };
  829. FFlippingBookModel.prototype.getUserCurrentPage2 = function()
  830. {
  831.    var _loc2_ = this._userCurrentPage;
  832.    if(this._view.__ox > 0)
  833.    {
  834.       _loc2_ += 1;
  835.    }
  836.    return _loc2_;
  837. };
  838. FFlippingBookModel.prototype.__addPage = function(index, pageSrc)
  839. {
  840.    this._realPages.splice(index,0,pageSrc);
  841. };
  842. FFlippingBookModel.prototype._copyArray = function(src)
  843. {
  844.    var _loc3_ = new Array();
  845.    var _loc1_ = 0;
  846.    while(_loc1_ < src.length)
  847.    {
  848.       _loc3_[_loc1_] = src[_loc1_];
  849.       _loc1_ = _loc1_ + 1;
  850.    }
  851.    return _loc3_;
  852. };
  853. FFlippingBookModel.prototype._makeItReal = function()
  854. {
  855.    this._realPages = this._copyArray(this._userPages);
  856.    var _loc2_ = true;
  857.    if(this._realPages.length % 2 == 0)
  858.    {
  859.       _loc2_ = false;
  860.    }
  861.    if(_loc2_)
  862.    {
  863.       this.__addPage(this._realPages.length,this._const.EMPTY_PAGE);
  864.    }
  865.    if(!this.alwaysOpened)
  866.    {
  867.       this.__addPage(0,this._const.TRANSPARENT_PAGE1);
  868.       this.__addPage(this._realPages.length,this._const.TRANSPARENT_PAGE2);
  869.    }
  870. };
  871. FFlippingBookModel.prototype._realPageNumber = function(n)
  872. {
  873.    if(n < 0)
  874.    {
  875.       this._userCurrentPage = n = 0;
  876.    }
  877.    else if(n >= this._userPages.length)
  878.    {
  879.       n = this._userPages.length - 1;
  880.       if(!this.alwaysOpened && this._userPages.length % 2 != 0)
  881.       {
  882.          n = n + 1;
  883.       }
  884.    }
  885.    if(!this.alwaysOpened)
  886.    {
  887.       n = n + 1;
  888.    }
  889.    if(this._userPages.length == 0)
  890.    {
  891.       n = 0;
  892.    }
  893.    if(n % 2 != 0)
  894.    {
  895.       n = n - 1;
  896.    }
  897.    return n;
  898. };
  899. FFlippingBookModel.prototype.putPage = function()
  900. {
  901.    if(this._view == undefined)
  902.    {
  903.       this._view = this._broker.objects[this._const.VIEW_OBJ_ID];
  904.    }
  905.    var _loc2_ = this.__direction;
  906.    this.__direction = -1;
  907.    switch(_loc2_)
  908.    {
  909.       case 0:
  910.          this._currentPage -= 2;
  911.          this._userCurrentPage -= 2;
  912.          break;
  913.       case 1:
  914.          this._currentPage += 2;
  915.          this._userCurrentPage += 2;
  916.    }
  917.    this._cache.setPage(this._view.__page01,this._realPages[this._currentPage],1,this._currentPage,_loc2_);
  918.    this._cache.setPage(this._view.__page02,this._realPages[this._currentPage + 1],2,this._currentPage + 1,_loc2_);
  919.    this._curPageNumbers[0] = this.getUserPageNumber(this._realPages[this._currentPage]);
  920.    this._curPageNumbers[1] = this.getUserPageNumber(this._realPages[this._currentPage + 1]);
  921.    if(this._realPages[this._currentPage] == this._const.EMPTY_PAGE)
  922.    {
  923.       this._curPageNumbers[0] = this._userPages.length;
  924.    }
  925.    vsrc = this._baseObj.pagesSet[this._userCurrentPage];
  926.    if(_loc2_ == 1)
  927.    {
  928.       if(this._cache.__pagesExt[vsrc] == true)
  929.       {
  930.          this._baseObj.onPutPage(this._curPageNumbers[0],this._cache.__pagesHolders[this._userPages[this._curPageNumbers[0]]]);
  931.       }
  932.       else
  933.       {
  934.          this._baseObj.onPutPage(this._curPageNumbers[0],this._cache.__pagesHolders[this._userPages[this._curPageNumbers[0]]].media);
  935.       }
  936.    }
  937.    else if(this._cache.__pagesExt[vsrc] == true)
  938.    {
  939.       this._baseObj.onPutPage(this._curPageNumbers[1],this._cache.__pagesHolders[this._userPages[this._curPageNumbers[1]]]);
  940.    }
  941.    else
  942.    {
  943.       this._baseObj.onPutPage(this._curPageNumbers[1],this._cache.__pagesHolders[this._userPages[this._curPageNumbers[1]]].media);
  944.    }
  945.    this._view.onSetPages(1,2);
  946.    if(this._currentPage + 2 > this._realPages.length - 1)
  947.    {
  948.       this._baseObj.onLastPage();
  949.    }
  950.    else if(this._currentPage - 2 < 0)
  951.    {
  952.       this._baseObj.onFirstPage();
  953.    }
  954. };
  955. FFlippingBookModel.prototype.goForward = function()
  956. {
  957.    if(this._currentPage != this._realPages.length - 2 && this._currentPage >= 0)
  958.    {
  959.       this._cache.setPage(this._view.__page03,this._realPages[this._currentPage + 2],3,this._currentPage + 2,1);
  960.       this._cache.setPage(this._view.__page04,this._realPages[this._currentPage + 3],4,this._currentPage + 3,1);
  961.       this._curPageNumbers[2] = this.getUserPageNumber(this._realPages[this._currentPage + 2]);
  962.       this._curPageNumbers[3] = this.getUserPageNumber(this._realPages[this._currentPage + 3]);
  963.       this.__direction = 1;
  964.    }
  965.    else
  966.    {
  967.       this._view._bookState = this._const.UNACTIVE_STATE;
  968.    }
  969. };
  970. FFlippingBookModel.prototype.goBack = function()
  971. {
  972.    if(this._currentPage > 0)
  973.    {
  974.       this._cache.setPage(this._view.__page03,this._realPages[this._currentPage - 1],3,this._currentPage - 1,0);
  975.       this._cache.setPage(this._view.__page04,this._realPages[this._currentPage - 2],4,this._currentPage - 2,0);
  976.       this._curPageNumbers[2] = this.getUserPageNumber(this._realPages[this._currentPage - 1]);
  977.       this._curPageNumbers[3] = this.getUserPageNumber(this._realPages[this._currentPage - 2]);
  978.       this.__direction = 0;
  979.    }
  980.    else
  981.    {
  982.       this._view._bookState = this._const.UNACTIVE_STATE;
  983.    }
  984. };
  985. FFlippingBookModel.prototype.getNextGotoPage = function(n)
  986. {
  987.    if(this._currentPage > n)
  988.    {
  989.       this.goBack();
  990.    }
  991.    else if(this._currentPage < n)
  992.    {
  993.       this.goForward();
  994.    }
  995.    else
  996.    {
  997.       this._baseObj.onEndGoto();
  998.       this._view._bookState = this._const.UNACTIVE_STATE;
  999.    }
  1000. };
  1001. FFlippingBookClass.prototype = new MovieClip();
  1002. FFlippingBookClass.prototype.getEnabledProp = function()
  1003. {
  1004.    return this.EnabledProp;
  1005. };
  1006. FFlippingBookClass.prototype.setEnabledProp = function(v)
  1007. {
  1008.    this.EnabledProp = v;
  1009. };
  1010. FFlippingBookClass.prototype.getPagesNumberProp = function()
  1011. {
  1012.    return this.pagesSet.length;
  1013. };
  1014. FFlippingBookClass.prototype.getAlwaysOpenedProp = function()
  1015. {
  1016.    return this.alwaysOpened;
  1017. };
  1018. FFlippingBookClass.prototype.getAutoFlipProp = function()
  1019. {
  1020.    return this.autoFlip;
  1021. };
  1022. FFlippingBookClass.prototype.setAutoFlipProp = function(v)
  1023. {
  1024.    this.autoFlip = v;
  1025.    if(this._view != undefined)
  1026.    {
  1027.       this._view._autoFlip = v;
  1028.    }
  1029. };
  1030. FFlippingBookClass.prototype.getFlipOnClick = function()
  1031. {
  1032.    return this.flipOnClick;
  1033. };
  1034. FFlippingBookClass.prototype.setFlipOnClick = function(v)
  1035. {
  1036.    this.flipOnClick = v;
  1037.    if(this._view != undefined)
  1038.    {
  1039.       this._view._flipOnClick = v;
  1040.    }
  1041. };
  1042. FFlippingBookClass.prototype.getMoveSpeedProp = function()
  1043. {
  1044.    return this.moveSpeed;
  1045. };
  1046. FFlippingBookClass.prototype.setMoveSpeedProp = function(v)
  1047. {
  1048.    this.moveSpeed = v;
  1049.    if(this._view != undefined)
  1050.    {
  1051.       this._view._pageSpeed = v / this._constants.SPEED_DIV;
  1052.    }
  1053. };
  1054. FFlippingBookClass.prototype.getCloseSpeedProp = function()
  1055. {
  1056.    return this.closeSpeed;
  1057. };
  1058. FFlippingBookClass.prototype.setCloseSpeedProp = function(v)
  1059. {
  1060.    this.closeSpeed = v;
  1061.    if(this._view != undefined)
  1062.    {
  1063.       this._view._closeSpeed = v / this._constants.SPEED_DIV;
  1064.    }
  1065. };
  1066. FFlippingBookClass.prototype.getGotoSpeedProp = function()
  1067. {
  1068.    return this.gotoSpeed;
  1069. };
  1070. FFlippingBookClass.prototype.setGotoSpeedProp = function(v)
  1071. {
  1072.    this.gotoSpeed = v;
  1073.    if(this._view != undefined)
  1074.    {
  1075.       this._view._gotoSpeed = v / this._constants.SPEED_DIV;
  1076.    }
  1077. };
  1078. FFlippingBookClass.prototype.flipForward = function()
  1079. {
  1080.    if(this._view != undefined)
  1081.    {
  1082.       var _loc2_ = this._model._currentPage + 2;
  1083.       this._view.gotoPage(_loc2_);
  1084.    }
  1085. };
  1086. FFlippingBookClass.prototype.flipBack = function()
  1087. {
  1088.    if(this._view != undefined)
  1089.    {
  1090.       var _loc2_ = this._model._currentPage - 2;
  1091.       this._view.gotoPage(_loc2_);
  1092.    }
  1093. };
  1094. FFlippingBookClass.prototype.setSize = function(w, h)
  1095. {
  1096.    this._bookWidth = w;
  1097.    this._bookHeight = h;
  1098.    this._xscale = 100;
  1099.    this._yscale = 100;
  1100.    if(this._view != undefined && (this._view._bookState == this._constants.UNACTIVE_STATE || this._view._bookState == this._constants.INIT_STATE))
  1101.    {
  1102.       this._view.setSize(w,h);
  1103.       this._cache.setSize(w,h);
  1104.    }
  1105. };
  1106. FFlippingBookClass.prototype._onXMLComplete = function()
  1107. {
  1108.    this._initFromCachedXML();
  1109.    this._getMedia();
  1110. };
  1111. FFlippingBookClass.prototype._getMedia = function()
  1112. {
  1113.    this._model = new FFlippingBookModel(this.pagesSet,this.firstPage,this.alwaysOpened,this._broker);
  1114.    this._cache.loadMedia(this._model._realPages,this.flipSound,this.pageBack,this._bookWidth,this._bookHeight);
  1115. };
  1116. FFlippingBookClass.prototype._onMediaComplete = function()
  1117. {
  1118.    if(this._model._userPages.length > 0)
  1119.    {
  1120.       this._view = new FFlippingBookView(this._bookWidth,this._bookHeight,this.autoFlip,this.flipOnClick,this._broker);
  1121.    }
  1122. };
  1123. FFlippingBookClass.prototype._initFromCachedXML = function()
  1124. {
  1125.    var _loc8_ = this._cache.extXML;
  1126.    var _loc9_ = _loc8_.firstChild;
  1127.    var _loc3_ = _loc9_.childNodes;
  1128.    var _loc2_ = 0;
  1129.    while(_loc3_[_loc2_])
  1130.    {
  1131.       var _loc7_ = _loc3_[_loc2_].nodeName.toUpperCase();
  1132.       switch(_loc7_)
  1133.       {
  1134.          case this._constants.WIDTH_NODE_NAME:
  1135.             this._bookWidth = _loc3_[_loc2_].firstChild.nodeValue;
  1136.             break;
  1137.          case this._constants.HEIGHT_NODE_NAME:
  1138.             this._bookHeight = _loc3_[_loc2_].firstChild.nodeValue;
  1139.             break;
  1140.          case this._constants.FIRST_PAGE_NODE_NAME:
  1141.             this.firstPage = _loc3_[_loc2_].firstChild.nodeValue;
  1142.             break;
  1143.          case this._constants.ALWAYS_OPENED_NODE_NAME:
  1144.             this.alwaysOpened = _loc3_[_loc2_].firstChild.nodeValue;
  1145.             break;
  1146.          case this._constants.AUTOFLIP_NODE_NAME:
  1147.             this.autoFlip = _loc3_[_loc2_].firstChild.nodeValue;
  1148.             break;
  1149.          case this._constants.FLIP_ON_CLICK_NODE_NAME:
  1150.             this.flipOnClick = _loc3_[_loc2_].firstChild.nodeValue;
  1151.             break;
  1152.          case this._constants.SCALE_CONTENT_NODE_NAME:
  1153.             this.scaleContent = _loc3_[_loc2_].firstChild.nodeValue;
  1154.             break;
  1155.          case this._constants.MOVE_SPEED_NODE_NAME:
  1156.             this.moveSpeed = _loc3_[_loc2_].firstChild.nodeValue;
  1157.             break;
  1158.          case this._constants.CLOSE_SPEED_NODE_NAME:
  1159.             this.closeSpeed = _loc3_[_loc2_].firstChild.nodeValue;
  1160.             break;
  1161.          case this._constants.GOTO_SPEED_NODE_NAME:
  1162.             this.gotoSpeed = _loc3_[_loc2_].firstChild.nodeValue;
  1163.             break;
  1164.          case this._constants.FLIP_SOUND_NODE_NAME:
  1165.             this.flipSound = this._removeWhite(_loc3_[_loc2_].firstChild.nodeValue);
  1166.             break;
  1167.          case this._constants.PAGE_BACK_NODE_NAME:
  1168.             this.pageBack = _loc3_[_loc2_].firstChild.nodeValue;
  1169.             break;
  1170.          case this._constants.LOAD_ON_DEMAND_NODE_NAME:
  1171.             this.loadOnDemand = _loc3_[_loc2_].firstChild.nodeValue;
  1172.             break;
  1173.          case this._constants.CACHE_PAGES_NODE_NAME:
  1174.             this.cachePages = _loc3_[_loc2_].firstChild.nodeValue;
  1175.             break;
  1176.          case this._constants.USE_PRELOADER_NODE_NAME:
  1177.             this.usePreloader = _loc3_[_loc2_].firstChild.nodeValue;
  1178.             break;
  1179.          case this._constants.SHADOWS_DEPTH_NODE_NAME:
  1180.             this.shadowsDepth = _loc3_[_loc2_].firstChild.nodeValue;
  1181.             break;
  1182.          case this._constants.PAGES_NODE_NAME:
  1183.             var _loc4_ = 0;
  1184.             var _loc5_ = _loc3_[_loc2_].childNodes;
  1185.             this.pagesSet = new Array();
  1186.             this.aniSwf = new Array();
  1187.             while(_loc5_[_loc4_])
  1188.             {
  1189.                var _loc6_ = this._removeWhite(_loc5_[_loc4_].firstChild.nodeValue);
  1190.                this.pagesSet.push(_loc6_);
  1191.                this.aniSwf.push(_loc5_[_loc4_].attributes.ani_swf);
  1192.                _loc4_ = _loc4_ + 1;
  1193.             }
  1194.       }
  1195.       _loc2_ = _loc2_ + 1;
  1196.    }
  1197.    this._validateParameters();
  1198. };
  1199. FFlippingBookClass.prototype._removeWhite = function(str)
  1200. {
  1201.    var _loc3_ = new String();
  1202.    var _loc4_ = str.length;
  1203.    var _loc6_ = 0;
  1204.    var _loc1_ = 0;
  1205.    while(_loc1_ < _loc4_)
  1206.    {
  1207.       var _loc2_ = str.charAt(_loc1_);
  1208.       if(_loc2_ != " ")
  1209.       {
  1210.          _loc3_ += _loc2_;
  1211.       }
  1212.       _loc1_ = _loc1_ + 1;
  1213.    }
  1214.    return _loc3_;
  1215. };
  1216. FFlippingBookClass.prototype._validateNumber = function(param, min, max, def)
  1217. {
  1218.    if(typeof param != this._constants.NUM_TYPE_NAME)
  1219.    {
  1220.       param = this._removeWhite(param);
  1221.       if(!isNaN(Number(param)))
  1222.       {
  1223.          param = Number(param);
  1224.       }
  1225.       else
  1226.       {
  1227.          param = def;
  1228.       }
  1229.    }
  1230.    if(param > max)
  1231.    {
  1232.       param = max;
  1233.    }
  1234.    if(param < min)
  1235.    {
  1236.       param = min;
  1237.    }
  1238.    return param;
  1239. };
  1240. FFlippingBookClass.prototype._validateBoolean = function(param, def)
  1241. {
  1242.    if(typeof param != this._constants.BOOL_TYPE_NAME)
  1243.    {
  1244.       param = param.toUpperCase();
  1245.       if(param.indexOf(this._constants.BOOL_TRUE_VAL) != -1)
  1246.       {
  1247.          param = true;
  1248.       }
  1249.       else if(param.indexOf(this._constants.BOOL_FALSE_VAL) != -1)
  1250.       {
  1251.          param = false;
  1252.       }
  1253.       else
  1254.       {
  1255.          param = def;
  1256.       }
  1257.    }
  1258.    return param;
  1259. };
  1260. FFlippingBookClass.prototype._validateColor = function(param)
  1261. {
  1262.    param = this._removeWhite(param);
  1263.    if(param < 0 || param > 16777215)
  1264.    {
  1265.       param = this._constants.DEF_PAGEBACK;
  1266.    }
  1267.    return param;
  1268. };
  1269. FFlippingBookClass.prototype._validateParameters = function()
  1270. {
  1271.    this._bookWidth = this._validateNumber(this._bookWidth,0,Infinity,this._constants.DEF_WIDTH);
  1272.    this._bookHeight = this._validateNumber(this._bookHeight,0,Infinity,this._constants.DEF_HEIGHT);
  1273.    this.firstPage = this._validateNumber(this.firstPage,0,Infinity,this._constants.DEF_FIRST_PAGE);
  1274.    this.moveSpeed = this._validateNumber(this.moveSpeed,0,Infinity,this._constants.DEF_MOVE_SPEED);
  1275.    this.closeSpeed = this._validateNumber(this.closeSpeed,0,Infinity,this._constants.DEF_CLOSE_SPEED);
  1276.    this.gotoSpeed = this._validateNumber(this.gotoSpeed,0,Infinity,this._constants.DEF_GOTO_SPEED);
  1277.    this.autoFlip = this._validateNumber(this.autoFlip,0,Infinity,this._constants.DEF_AUTOFLIP);
  1278.    this._cache.sd = this.shadowsDepth = this._validateNumber(this.shadowsDepth,0,Infinity,this._constants.DEF_SHADOWS_DEPTH);
  1279.    this.pageBack = this._validateColor(this.pageBack);
  1280.    this.alwaysOpened = this._validateBoolean(this.alwaysOpened,this._constants.DEF_ALWAYS_OPENED);
  1281.    this.flipOnClick = this._validateBoolean(this.flipOnClick,this._constants.DEF_FLIP_ON_CLICK);
  1282.    this.loadOnDemand = this._validateBoolean(this.loadOnDemand,this._constants.DEF_LOAD_ON_DEMAND);
  1283.    this.cachePages = this._validateBoolean(this.cachePages,this._constants.DEF_CACHE_PAGES);
  1284.    this.usePreloader = this._validateBoolean(this.usePreloader,this._constants.DEF_USE_PRELOADER);
  1285.    this.scaleContent = this._validateBoolean(this.scaleContent,this._constants.DEF_SCALE_CONTENT);
  1286.    this._cache.usePreloader = this.usePreloader;
  1287.    this._cache.cachePages = this.cachePages;
  1288.    this._cache.loadOnDemand = this.loadOnDemand;
  1289.    this._cache.bgColor = this.pageBack;
  1290. };
  1291. FFlippingBookClass.prototype.gotoPage = function(i)
  1292. {
  1293.    if(this._view != undefined)
  1294.    {
  1295.       this._view.gotoPage(i);
  1296.    }
  1297. };
  1298. FFlippingBookClass.prototype.directGotoPage = function(i)
  1299. {
  1300.    if(this._view != undefined)
  1301.    {
  1302.       this._view.directGotoPage(i);
  1303.    }
  1304. };
  1305. FFlippingBookView.prototype.setSize = function(w, h)
  1306. {
  1307.    this._pageWidth = w / 2;
  1308.    this._pageHeight = h;
  1309.    this.tmp01._x = this.__page01._x = - this._pageWidth;
  1310.    this.tmp01._y = this.__page01._y = (- this._pageHeight) / 2;
  1311.    this.tmp02._x = this.__page02._x = 0;
  1312.    this.tmp02._y = this.__page02._y = (- this._pageHeight) / 2;
  1313.    this.tmp03._y = this.__page03._y = (- this._pageHeight) / 2;
  1314.    this.tmp04._y = this.__page04._y = (- this._pageHeight) / 2;
  1315.    this.__pagesShadowMask._x = - this._pageWidth;
  1316.    this.__pagesShadowMask._y = (- this._pageHeight) / 2;
  1317.    this.__mask03._y = (- this._pageHeight) / 2;
  1318.    this.__mask12._y = (- this._pageHeight) / 2;
  1319.    this.__shMask03._y = (- this._pageHeight) / 2;
  1320.    this.__shMask04._y = (- this._pageHeight) / 2;
  1321.    this._drawShadow12();
  1322.    this._drawShadow03();
  1323.    this._drawShadow04();
  1324. };
  1325. FFlippingBookView.prototype._drawBook = function()
  1326. {
  1327.    this.__page04 = this.tmp04 = this._baseObj.createEmptyMovieClip(this._const.PAGE_04_MC_NAME,this._depth++);
  1328.    this.__shadow04 = this._baseObj.createEmptyMovieClip(this._const.SHADOW_04_MC_NAME,this._depth++);
  1329.    this.__shMask04 = this._baseObj.createEmptyMovieClip(this._const.SH_MASK_04_MC_NAME,this._depth++);
  1330.    this.__page01 = this.tmp01 = this._baseObj.createEmptyMovieClip(this._const.PAGE_01_MC_NAME,this._depth++);
  1331.    this.__page02 = this.tmp02 = this._baseObj.createEmptyMovieClip(this._const.PAGE_02_MC_NAME,this._depth++);
  1332.    this.__staticShadow = this._baseObj.createEmptyMovieClip(this._const.STATIC_SHADOW_MC_NAME,this._depth++);
  1333.    this.__pagesShadow = this._baseObj.createEmptyMovieClip(this._const.PAGES_SH_MC_NAME,this._depth++);
  1334.    this.__pagesShadowMask = this._baseObj.createEmptyMovieClip(this._const.PAGES_SHM_MC_NAME,this._depth++);
  1335.    this.__mask12 = this._baseObj.createEmptyMovieClip(this._const.MASK_12_MC_NAME,this._depth++);
  1336.    this.__page03 = this.tmp03 = this._baseObj.createEmptyMovieClip(this._const.PAGE_03_MC_NAME,this._depth++);
  1337.    this.__mask03 = this._baseObj.createEmptyMovieClip(this._const.MASK_03_MC_NAME,this._depth++);
  1338.    this.__page03.setMask(this.__mask03);
  1339.    this.__shadow03 = this._baseObj.createEmptyMovieClip(this._const.SHADOW_03_MC_NAME,this._depth++);
  1340.    this.__shMask03 = this._baseObj.createEmptyMovieClip(this._const.SH_MASK_03_MC_NAME,this._depth++);
  1341.    this.__page01._x = - this._pageWidth;
  1342.    this.__page01._y = (- this._pageHeight) / 2;
  1343.    this.__page02._x = 0;
  1344.    this.__page02._y = (- this._pageHeight) / 2;
  1345.    this.__page03._y = (- this._pageHeight) / 2;
  1346.    this.__page04._y = (- this._pageHeight) / 2;
  1347.    this.__pagesShadowMask._x = - this._pageWidth;
  1348.    this.__pagesShadowMask._y = (- this._pageHeight) / 2;
  1349.    this.__mask03._y = (- this._pageHeight) / 2;
  1350.    this.__mask12._y = (- this._pageHeight) / 2;
  1351.    this.__shMask03._y = (- this._pageHeight) / 2;
  1352.    this.__shMask04._y = (- this._pageHeight) / 2;
  1353.    this._drawShadow12();
  1354.    this._drawShadow03();
  1355.    this._drawShadow04();
  1356. };
  1357. FFlippingBookView.prototype.__redrawBook = function()
  1358. {
  1359.    this.__drawShadow03();
  1360.    this.__mask03._x = 0;
  1361.    this.__drawShadow04();
  1362.    this.__mask12._x = 0;
  1363.    this._drawShadow12();
  1364. };
  1365. FFlippingBookView.prototype._drawShadow12 = function()
  1366. {
  1367.    this.__pagesShadow._x = 0;
  1368.    this.__pagesShadow._y = 0;
  1369.    this.__pagesShadow.clear();
  1370.    var sw = this._const.SH12_SCALE * this._pageWidth;
  1371.    var sh = this.__pagesShadowHeight;
  1372.    var colors = [0,0];
  1373.    var ratios = [0,255];
  1374.    var alphas = [0,25 * this.sd];
  1375.    var matrix = {matrixType:"box",x:- sw,y:(- sh) / 2,w:sw,h:sh,r:0};
  1376.    with(this.__pagesShadow)
  1377.    {
  1378.       moveTo(- sw,(- sh) / 2);
  1379.       beginGradientFill("linear",colors,alphas,ratios,matrix);
  1380.       lineTo(0,(- sh) / 2);
  1381.       lineTo(0,sh / 2);
  1382.       lineTo(- sw,sh / 2);
  1383.       lineTo(- sw,(- sh) / 2);
  1384.       endFill();
  1385.    }
  1386.    this.__pagesShadow._visible = false;
  1387. };
  1388. FFlippingBookView.prototype.__drawShadow12Mask = function()
  1389. {
  1390.    this.__pagesShadowMask.clear();
  1391.    var ax = 0;
  1392.    var ay = this._pageHeight;
  1393.    var bx = 0;
  1394.    var by = 0;
  1395.    var cx = 2 * this._pageWidth;
  1396.    var cy = 0;
  1397.    var dx = 2 * this._pageWidth;
  1398.    var dy = this._pageHeight;
  1399.    if(this._transpPage == 1)
  1400.    {
  1401.       ax += this._pageWidth;
  1402.       bx += this._pageWidth;
  1403.    }
  1404.    else if(this._transpPage == 2)
  1405.    {
  1406.       cx -= this._pageWidth;
  1407.       dx -= this._pageWidth;
  1408.    }
  1409.    with(this.__pagesShadowMask)
  1410.    {
  1411.       moveTo(ax,ay);
  1412.       beginFill(0,100);
  1413.       lineTo(bx,by);
  1414.       lineTo(cx,cy);
  1415.       lineTo(dx,dy);
  1416.       lineTo(ax,ay);
  1417.       endFill();
  1418.    }
  1419.    this.__pagesShadow.setMask(this.__pagesShadowMask);
  1420. };
  1421. FFlippingBookView.prototype._drawShadow03 = function()
  1422. {
  1423.    this.__shadow03._x = 0;
  1424.    this.__shadow03._y = 0;
  1425.    this.__shadow03.clear();
  1426.    var sw = this._const.SH3_SCALE * this._pageWidth;
  1427.    var sh = this.__shadowHeight;
  1428.    var colors = [0,0,0,0];
  1429.    var ratios = [0,200,242,255];
  1430.    var alphas = [0,10 * this.sd,20 * this.sd,0];
  1431.    var matrix = {matrixType:"box",x:- sw,y:(- sh) / 2,w:sw,h:sh,r:0};
  1432.    with(this.__shadow03)
  1433.    {
  1434.       moveTo(- sw,(- sh) / 2);
  1435.       beginGradientFill("linear",colors,alphas,ratios,matrix);
  1436.       lineTo(0,(- sh) / 2);
  1437.       lineTo(0,sh / 2);
  1438.       lineTo(- sw,sh / 2);
  1439.       lineTo(- sw,(- sh) / 2);
  1440.       endFill();
  1441.    }
  1442.    this.__shadow03._visible = false;
  1443. };
  1444. FFlippingBookView.prototype._drawShadow04 = function()
  1445. {
  1446.    this.__shadow04._x = 0;
  1447.    this.__shadow04._y = 0;
  1448.    this.__shadow04.clear();
  1449.    var sw = 0.6 * this._pageWidth;
  1450.    var sh = this.__shadowHeight;
  1451.    var colors = [0,0];
  1452.    var ratios = [0,255];
  1453.    var alphas = [0,35 * this.sd];
  1454.    var matrix = {matrixType:"box",x:- sw,y:(- sh) / 2,w:sw,h:sh,r:0};
  1455.    with(this.__shadow04)
  1456.    {
  1457.       moveTo(- sw,(- sh) / 2);
  1458.       beginGradientFill("linear",colors,alphas,ratios,matrix);
  1459.       lineTo(0,(- sh) / 2);
  1460.       lineTo(0,sh / 2);
  1461.       lineTo(- sw,sh / 2);
  1462.       lineTo(- sw,(- sh) / 2);
  1463.       endFill();
  1464.    }
  1465.    this.__shadow04._visible = false;
  1466. };
  1467. FFlippingBookView.prototype.__isCorner = function(x, y)
  1468. {
  1469.    if(x > this._pageWidth - this._autoFlip)
  1470.    {
  1471.       if(x < this._pageWidth)
  1472.       {
  1473.          if(y > this._pageHeight / 2 - this._autoFlip)
  1474.          {
  1475.             if(y < this._pageHeight / 2)
  1476.             {
  1477.                return true;
  1478.             }
  1479.          }
  1480.       }
  1481.    }
  1482.    return false;
  1483. };
  1484. FFlippingBookView.prototype.__onMouseUp = function()
  1485. {
  1486.    var _loc2_ = this._view;
  1487.    if(_loc2_._bookState == this._constants.FLIPPING_STATE)
  1488.    {
  1489.       _loc2_._flipSound.start(0,1);
  1490.       var _loc4_ = this._xmouse;
  1491.       var _loc5_ = this._ymouse;
  1492.       var _loc3_ = _loc2_.__ox;
  1493.       _loc2_._bookState = this._constants.FLIPBACK_STATE;
  1494.       if(_loc3_ < 0 && _loc4_ > 0 || _loc3_ > 0 && _loc4_ < 0)
  1495.       {
  1496.       }
  1497.       _loc2_._bookState = this._constants.FLIPOVER_STATE;
  1498.    }
  1499. };
  1500. FFlippingBookView.prototype.__onMouseDown = function()
  1501. {
  1502.    var _loc2_ = this._view;
  1503.    var _loc3_ = this._xmouse;
  1504.    var _loc5_ = this._ymouse;
  1505.    if(_loc3_ > - _loc2_._pageWidth && _loc5_ > (- _loc2_._pageHeight) / 2 && _loc3_ < - _loc2_._pageWidth + 30 && _loc5_ < _loc2_._pageHeight / 2 or _loc3_ > _loc2_._pageWidth - 30 && _loc5_ > (- _loc2_._pageHeight) / 2 && _loc3_ < _loc2_._pageWidth && _loc5_ < _loc2_._pageHeight / 2)
  1506.    {
  1507.       var _loc4_ = false;
  1508.       if(_loc2_._bookState == this._constants.AUTOFLIP_STATE)
  1509.       {
  1510.          _loc4_ = true;
  1511.       }
  1512.       if(_loc3_ < 0)
  1513.       {
  1514.          var _loc8_ = _loc2_._baseObj.pagesSet[_loc2_._model._userCurrentPage];
  1515.          var _loc7_ = _loc2_._model._curPageNumbers[0];
  1516.          var _loc6_ = _loc2_._cache.__pagesHolders[_loc2_._model._userPages[_loc2_._model._curPageNumbers[0]]];
  1517.          if(_loc2_._cache.__pagesExt[_loc8_] == true)
  1518.          {
  1519.             _loc2_._baseObj.onClick(_loc7_,_loc6_,_loc4_);
  1520.          }
  1521.          else
  1522.          {
  1523.             _loc2_._baseObj.onClick(_loc7_,_loc6_.media,_loc4_);
  1524.          }
  1525.       }
  1526.       else if(_loc3_ > 0)
  1527.       {
  1528.          _loc8_ = _loc2_._baseObj.pagesSet[_loc2_._model._userCurrentPage];
  1529.          _loc7_ = _loc2_._model._curPageNumbers[1];
  1530.          _loc6_ = _loc2_._cache.__pagesHolders[_loc2_._model._userPages[_loc2_._model._curPageNumbers[1]]];
  1531.          if(_loc2_._cache.__pagesExt[_loc8_] == true)
  1532.          {
  1533.             _loc2_._baseObj.onClick(_loc7_,_loc6_,_loc4_);
  1534.          }
  1535.          else
  1536.          {
  1537.             _loc2_._baseObj.onClick(_loc7_,_loc6_.media,_loc4_);
  1538.          }
  1539.       }
  1540.    }
  1541.    if(!_loc2_._flipOnClick && _loc2_._bookState != this._constants.AUTOFLIP_STATE)
  1542.    {
  1543.       return undefined;
  1544.    }
  1545.    if(_loc4_)
  1546.    {
  1547.       _loc2_._baseObj.onClickAndDrag();
  1548.       _loc2_._flipSound.start(0,1);
  1549.       if(_loc2_._flipOnClick)
  1550.       {
  1551.          _loc2_._bookState = this._constants.FLIPOVER_STATE;
  1552.       }
  1553.       else
  1554.       {
  1555.          _loc2_._bookState = this._constants.FLIPPING_STATE;
  1556.       }
  1557.    }
  1558.    if(_loc3_ != 0 && (_loc3_ > - _loc2_._pageWidth && _loc5_ > (- _loc2_._pageHeight) / 2 && _loc3_ < - _loc2_._pageWidth + 30 && _loc5_ < _loc2_._pageHeight / 2 or _loc3_ > _loc2_._pageWidth - 30 && _loc5_ > (- _loc2_._pageHeight) / 2 && _loc3_ < _loc2_._pageWidth && _loc5_ < _loc2_._pageHeight / 2))
  1559.    {
  1560.       if(_loc2_._bookState == this._constants.UNACTIVE_STATE)
  1561.       {
  1562.          _loc2_._bookState = this._constants.FLIPPING_STATE;
  1563.          var _loc9_ = Math.sqrt(_loc3_ * _loc3_ + _loc5_ * _loc5_);
  1564.          var _loc10_ = Math.asin(_loc5_ / _loc9_);
  1565.          _loc5_ = Math.tan(_loc10_) * _loc2_._pageWidth;
  1566.          if(_loc5_ > _loc2_._pageHeight / 2)
  1567.          {
  1568.             _loc5_ = _loc2_._pageHeight / 2;
  1569.          }
  1570.          if(_loc5_ < (- _loc2_._pageHeight) / 2)
  1571.          {
  1572.             _loc5_ = (- _loc2_._pageHeight) / 2;
  1573.          }
  1574.          _loc2_.__oy = _loc5_;
  1575.          if(_loc3_ < 0)
  1576.          {
  1577.             _loc2_.__page04._x = - _loc2_._pageWidth;
  1578.             _loc2_.__ox = - _loc2_._pageWidth;
  1579.             _loc2_._model.goBack();
  1580.          }
  1581.          if(_loc3_ > 0)
  1582.          {
  1583.             _loc2_.__page04._x = 0;
  1584.             _loc2_.__ox = _loc2_._pageWidth;
  1585.             _loc2_._model.goForward();
  1586.          }
  1587.          if(_loc2_._bookState != this._constants.UNACTIVE_STATE)
  1588.          {
  1589.             _loc2_.__pagesShadow._visible = true;
  1590.             _loc2_.__shadow03._visible = true;
  1591.             _loc2_.__shadow04._visible = true;
  1592.             _loc2_.__shadow03.setMask(_loc2_.__shMask03);
  1593.             _loc2_.__shadow04.setMask(_loc2_.__shMask04);
  1594.             _loc2_.__drawShadow12Mask();
  1595.          }
  1596.          _loc2_.__oldX = _loc2_.__ox;
  1597.          _loc2_.__oldY = _loc2_.__oy;
  1598.          _loc2_._baseObj.onStartFlip(_loc2_._model._curPageNumbers[2]);
  1599.       }
  1600.    }
  1601. };
  1602. FFlippingBookView.prototype.onSetPages = function(i, j)
  1603. {
  1604.    if(this._bookState == this._const.INIT_STATE)
  1605.    {
  1606.       this._bookState = this._const.UNACTIVE_STATE;
  1607.    }
  1608.    else if(this._bookState == this._const.UNACTIVE_STATE)
  1609.    {
  1610.       this.__redrawBook();
  1611.    }
  1612.    else if(this._bookState == this._const.GOTOPAGE_STATE && i == 1)
  1613.    {
  1614.       this.__redrawBook();
  1615.       this.__oldX = 0;
  1616.       this.__oldY = 0;
  1617.       this._model.getNextGotoPage(this.__gotoPageIndex);
  1618.       if(this._bookState != this._const.UNACTIVE_STATE)
  1619.       {
  1620.          this._flipSound.start(0,1);
  1621.          this.__pagesShadow._visible = true;
  1622.          this.__shadow03._visible = true;
  1623.          this.__shadow04._visible = true;
  1624.          this.__shadow03.setMask(this.__shMask03);
  1625.          this.__shadow04.setMask(this.__shMask04);
  1626.          this.__drawShadow12Mask();
  1627.       }
  1628.    }
  1629. };
  1630. FFlippingBookView.prototype.__onEnterFrame = function()
  1631. {
  1632.    if(!this._visible || !this.enabledProp)
  1633.    {
  1634.       return undefined;
  1635.    }
  1636.    var _loc2_ = this._view;
  1637.    var _loc3_ = this._xmouse;
  1638.    var _loc4_ = this._ymouse;
  1639.    if(_loc2_._bookState == _loc2_._const.AUTOFLIP_STATE)
  1640.    {
  1641.       if(!_loc2_.__isCorner(Math.abs(_loc3_),Math.abs(_loc4_)))
  1642.       {
  1643.          _loc2_._bookState = _loc2_._const.FLIPBACK_STATE;
  1644.       }
  1645.    }
  1646.    else if(_loc2_._bookState == _loc2_._const.UNACTIVE_STATE && _loc2_._autoFlip != 0)
  1647.    {
  1648.       if(_loc2_.__isCorner(Math.abs(_loc3_),Math.abs(_loc4_)))
  1649.       {
  1650.          _loc2_._bookState = _loc2_._const.AUTOFLIP_STATE;
  1651.          var _loc5_ = Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_);
  1652.          var _loc6_ = Math.asin(_loc4_ / _loc5_);
  1653.          _loc4_ = Math.tan(_loc6_) * _loc2_._pageWidth;
  1654.          if(_loc4_ > 0)
  1655.          {
  1656.             _loc4_ = _loc2_._pageHeight / 2;
  1657.          }
  1658.          if(_loc4_ < 0)
  1659.          {
  1660.             _loc4_ = (- _loc2_._pageHeight) / 2;
  1661.          }
  1662.          _loc2_.__oy = _loc4_;
  1663.          _loc4_ = this._ymouse;
  1664.          if(_loc3_ < 0)
  1665.          {
  1666.             _loc2_.__page04._x = - _loc2_._pageWidth;
  1667.             _loc2_.__ox = - _loc2_._pageWidth;
  1668.             _loc2_._model.goBack();
  1669.          }
  1670.          if(_loc3_ > 0)
  1671.          {
  1672.             _loc2_.__page04._x = 0;
  1673.             _loc2_.__ox = _loc2_._pageWidth;
  1674.             _loc2_._model.goForward();
  1675.          }
  1676.          if(_loc2_._bookState != this._constants.UNACTIVE_STATE)
  1677.          {
  1678.             _loc2_.__pagesShadow._visible = true;
  1679.             _loc2_.__shadow03._visible = true;
  1680.             _loc2_.__shadow04._visible = true;
  1681.             _loc2_.__shadow03.setMask(_loc2_.__shMask03);
  1682.             _loc2_.__shadow04.setMask(_loc2_.__shMask04);
  1683.             _loc2_.__drawShadow12Mask();
  1684.          }
  1685.          _loc2_.__oldX = _loc2_.__ox;
  1686.          _loc2_.__oldY = _loc2_.__oy;
  1687.          _loc2_._baseObj.onStartFlip(_loc2_._model._curPageNumbers[2]);
  1688.       }
  1689.    }
  1690.    if(_loc2_._bookState == _loc2_._const.FLIPPING_STATE || _loc2_._bookState == _loc2_._const.AUTOFLIP_STATE)
  1691.    {
  1692.       var _loc0_ = null;
  1693.       _loc3_ = _loc2_.__oldX += (_loc3_ - _loc2_.__oldX) * _loc2_._pageSpeed;
  1694.       var _loc0_ = null;
  1695.       _loc4_ = _loc2_.__oldY += (_loc4_ - _loc2_.__oldY) * _loc2_._pageSpeed;
  1696.       _loc2_.__movePage(_loc3_,_loc4_);
  1697.    }
  1698.    else if(_loc2_._bookState == _loc2_._const.FLIPOVER_STATE)
  1699.    {
  1700.       var _loc0_ = null;
  1701.       _loc3_ = _loc2_.__oldX += (- _loc2_.__ox - _loc2_.__oldX) * _loc2_._closeSpeed;
  1702.       var _loc0_ = null;
  1703.       _loc4_ = _loc2_.__oldY += (_loc2_.__oy - _loc2_.__oldY) * _loc2_._closeSpeed;
  1704.       _loc2_.__movePage(_loc3_,_loc4_);
  1705.       if(_loc3_ / (- _loc2_.__ox) > _loc2_._minOffset)
  1706.       {
  1707.          _loc2_._bookState = _loc2_._const.UNACTIVE_STATE;
  1708.          _loc2_._cache.restorePages();
  1709.          _loc2_._model.putPage();
  1710.       }
  1711.    }
  1712.    else if(_loc2_._bookState == _loc2_._const.FLIPBACK_STATE)
  1713.    {
  1714.       var _loc0_ = null;
  1715.       _loc3_ = _loc2_.__oldX += (_loc2_.__ox - _loc2_.__oldX) * _loc2_._closeSpeed;
  1716.       var _loc0_ = null;
  1717.       _loc4_ = _loc2_.__oldY += (_loc2_.__oy - _loc2_.__oldY) * _loc2_._closeSpeed;
  1718.       _loc2_.__movePage(_loc3_,_loc4_);
  1719.       if(_loc3_ / _loc2_.__ox > _loc2_._minOffset)
  1720.       {
  1721.          _loc2_._baseObj.onFlipBack(_loc2_._model._curPageNumbers[2]);
  1722.          _loc2_._bookState = _loc2_._const.UNACTIVE_STATE;
  1723.          _loc2_._cache.restoreWorkPages();
  1724.          _loc2_.redrawBook();
  1725.       }
  1726.    }
  1727.    else if(_loc2_._bookState == _loc2_._const.GOTOPAGE_STATE)
  1728.    {
  1729.       var _loc0_ = null;
  1730.       _loc3_ = _loc2_.__oldX += (- _loc2_.__ox - _loc2_.__oldX) * _loc2_._gotoSpeed;
  1731.       var _loc0_ = null;
  1732.       _loc4_ = _loc2_.__oldY += (_loc2_.__oy - _loc2_.__oldY) * _loc2_._gotoSpeed;
  1733.       _loc2_.__movePage(_loc3_,_loc4_);
  1734.       if(_loc3_ / (- _loc2_.__ox) > _loc2_._minOffset)
  1735.       {
  1736.          _loc2_._cache.restorePages();
  1737.          _loc2_._model.putPage();
  1738.       }
  1739.    }
  1740. };
  1741. FFlippingBookView.prototype.__movePage = function(x, y)
  1742. {
  1743.    var _loc4_ = this._pageHeight / 2;
  1744.    var _loc5_ = this._pageWidth;
  1745.    var _loc7_ = Math.sqrt((_loc4_ + this.__oy) * (_loc4_ + this.__oy) + _loc5_ * _loc5_);
  1746.    var _loc6_ = Math.sqrt((_loc4_ - this.__oy) * (_loc4_ - this.__oy) + _loc5_ * _loc5_);
  1747.    var _loc11_ = Math.sqrt((_loc4_ + y) * (_loc4_ + y) + x * x);
  1748.    var _loc10_ = Math.sqrt((_loc4_ - y) * (_loc4_ - y) + x * x);
  1749.    if(_loc11_ > _loc7_ || _loc10_ > _loc6_)
  1750.    {
  1751.       if(y < this.__oy)
  1752.       {
  1753.          var _loc8_ = Math.asin((_loc4_ - y) / _loc10_);
  1754.          y = _loc4_ - Math.sin(_loc8_) * _loc6_;
  1755.          x = x >= 0 ? Math.cos(_loc8_) * _loc6_ : (- Math.cos(_loc8_)) * _loc6_;
  1756.          if(y > this.__oy)
  1757.          {
  1758.             if(this.__ox * x > 0)
  1759.             {
  1760.                y = this.__oy;
  1761.                x = this.__ox;
  1762.             }
  1763.             else
  1764.             {
  1765.                y = this.__oy;
  1766.                x = - this.__ox;
  1767.             }
  1768.          }
  1769.       }
  1770.       else
  1771.       {
  1772.          _loc8_ = Math.asin((y + _loc4_) / _loc11_);
  1773.          y = Math.sin(_loc8_) * _loc7_ - _loc4_;
  1774.          x = x >= 0 ? Math.cos(_loc8_) * _loc7_ : (- Math.cos(_loc8_)) * _loc7_;
  1775.          if(y < this.__oy)
  1776.          {
  1777.             if(this.__ox * x > 0)
  1778.             {
  1779.                y = this.__oy;
  1780.                x = this.__ox;
  1781.             }
  1782.             else
  1783.             {
  1784.                y = this.__oy;
  1785.                x = - this.__ox;
  1786.             }
  1787.          }
  1788.       }
  1789.    }
  1790.    if(this.__ox < 0 && x - this.__ox < 5 || this.__ox > 0 && this.__ox - x < 5)
  1791.    {
  1792.       if(this.__ox < 0)
  1793.       {
  1794.          x = - _loc5_ + 5;
  1795.       }
  1796.       if(this.__ox > 0)
  1797.       {
  1798.          x = _loc5_ - 5;
  1799.       }
  1800.    }
  1801.    var _loc18_ = this.__oy - y;
  1802.    var _loc19_ = this.__ox - x;
  1803.    var _loc15_ = Math.atan(_loc18_ / _loc19_);
  1804.    var _loc9_ = 2 * _loc15_;
  1805.    var _loc17_ = _loc9_ * 57.29577951308232;
  1806.    var _loc16_ = Math.sin(_loc9_);
  1807.    var _loc14_ = Math.cos(_loc9_);
  1808.    var _loc13_ = x + (_loc4_ + this.__oy) * _loc16_ - (_loc5_ - this.__ox) / 2 * _loc14_;
  1809.    var _loc12_ = y - (_loc4_ + this.__oy) * _loc14_ - (_loc5_ - this.__ox) / 2 * _loc16_;
  1810.    this.__page03._rotation = _loc17_;
  1811.    this.__page03._x = _loc13_;
  1812.    this.__page03._y = _loc12_;
  1813.    this.__drawMasks(_loc15_,_loc13_,_loc12_,x,y);
  1814.    this.__page03._visible = true;
  1815.    this.__page04._visible = true;
  1816. };
  1817. FFlippingBookView.prototype.__drawMasks = function(beta, x, y, _mx, _my)
  1818. {
  1819.    var pageH = this._pageHeight;
  1820.    var pageH2 = pageH / 2;
  1821.    var pageW = this._pageWidth;
  1822.    var r = Math.sqrt((this.__ox - _mx) * (this.__ox - _mx) + (this.__oy - _my) * (this.__oy - _my));
  1823.    var alpha = 2 * beta;
  1824.    var cos_a = Math.cos(alpha);
  1825.    var sin_a = Math.sin(alpha);
  1826.    var cos_b = Math.cos(beta);
  1827.    var sin_b = Math.sin(beta);
  1828.    var tan_a = sin_a / cos_a;
  1829.    var tan_b = Math.tan(beta);
  1830.    var bx = 0;
  1831.    var by = 0;
  1832.    var ax = 0;
  1833.    var ay = pageH;
  1834.    y += pageH2;
  1835.    bx = x - y / tan_a;
  1836.    ax = bx - pageH * tan_b;
  1837.    if(beta == 0)
  1838.    {
  1839.       if(this.__ox < 0 && x < 0)
  1840.       {
  1841.          x = ax = bx = - pageW;
  1842.       }
  1843.       else if(this.__ox > 0 && x > 0)
  1844.       {
  1845.          x = ax = bx = pageW;
  1846.       }
  1847.       else
  1848.       {
  1849.          ax = bx = 0;
  1850.       }
  1851.    }
  1852.    var cx = this.__ox <= 0 ? - pageW : pageW;
  1853.    var cy = 0;
  1854.    var dx = cx;
  1855.    var dy = pageH;
  1856.    var k = this.__ox <= 0 ? 1 : 0;
  1857.    var px = x + k * pageW * cos_a;
  1858.    var py = y + k * pageW * sin_a;
  1859.    var fx = px - pageH * sin_a;
  1860.    var fy = py + pageH * cos_a;
  1861.    var lx = cx;
  1862.    var ly = beta == 0 ? -1 : (bx - cx) / tan_b;
  1863.    var tmpx = 0;
  1864.    var tmpy = 0;
  1865.    var ccx = cx;
  1866.    var ddx = dx;
  1867.    cx = 0;
  1868.    dx = 0;
  1869.    if(this._transpPage04)
  1870.    {
  1871.       ccx = ddx = cx;
  1872.    }
  1873.    if(ly < 0 || ly > pageH)
  1874.    {
  1875.       with(this.__mask03)
  1876.       {
  1877.          clear();
  1878.          moveTo(ax,ay);
  1879.          beginFill(16776960,100);
  1880.          lineTo(bx,by);
  1881.          lineTo(px,py);
  1882.          lineTo(fx,fy);
  1883.          lineTo(ax,ay);
  1884.          endFill();
  1885.       }
  1886.       with(this.__mask12)
  1887.       {
  1888.          clear();
  1889.          moveTo(ax,ay);
  1890.          beginFill(0,100);
  1891.          lineTo(bx,by);
  1892.          lineTo(cx,cy);
  1893.          lineTo(dx,dy);
  1894.          lineTo(ax,ay);
  1895.          endFill();
  1896.       }
  1897.       with(this.__shMask03)
  1898.       {
  1899.          clear();
  1900.          moveTo(ax,ay);
  1901.          beginFill(16776960,100);
  1902.          lineTo(bx,by);
  1903.          lineTo(px,py);
  1904.          lineTo(fx,fy);
  1905.          lineTo(ax,ay);
  1906.          endFill();
  1907.       }
  1908.       with(this.__shMask04)
  1909.       {
  1910.          clear();
  1911.          moveTo(ax,ay);
  1912.          beginFill(0,100);
  1913.          lineTo(bx,by);
  1914.          lineTo(ccx,cy);
  1915.          lineTo(ddx,dy);
  1916.          lineTo(ax,ay);
  1917.          endFill();
  1918.       }
  1919.       with(this.__pagesShadow)
  1920.       {
  1921.          _rotation = beta * this.radIndex;
  1922.          _xscale = this.__ox <= 0 ? (- r) / 4 : r / 4;
  1923.          ay -= pageH2;
  1924.          by -= pageH2;
  1925.          var ab = Math.sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
  1926.          _alpha = 2 * pageW - r >= 50 ? 100 : 2 * (2 * pageW - r);
  1927.          _x = bx - ab / 2 * sin_b;
  1928.          _y = by + ab / 2 * cos_b;
  1929.       }
  1930.       with(this.__shadow03)
  1931.       {
  1932.          _rotation = this.__pagesShadow._rotation;
  1933.          _xscale = this.__pagesShadow._xscale;
  1934.          _alpha = this.__pagesShadow._alpha;
  1935.          _x = this.__pagesShadow._x;
  1936.          _y = this.__pagesShadow._y;
  1937.       }
  1938.       with(this.__shadow04)
  1939.       {
  1940.          _rotation = this.__pagesShadow._rotation;
  1941.          _xscale = - this.__pagesShadow._xscale;
  1942.          _alpha = this.__pagesShadow._alpha;
  1943.          _x = this.__pagesShadow._x;
  1944.          _y = this.__pagesShadow._y;
  1945.       }
  1946.    }
  1947.    else
  1948.    {
  1949.       if(bx > pageW || bx < - pageW)
  1950.       {
  1951.          bx = ax;
  1952.          by = ay;
  1953.          tmpx = cx;
  1954.          tmpy = cy;
  1955.          cx = dx;
  1956.          cy = dy;
  1957.          dx = tmpx;
  1958.          dy = tmpy;
  1959.          px = fx;
  1960.          py = fy;
  1961.       }
  1962.       with(this.__mask03)
  1963.       {
  1964.          clear();
  1965.          moveTo(lx,ly);
  1966.          beginFill(16711680,100);
  1967.          lineTo(px,py);
  1968.          lineTo(bx,by);
  1969.          lineTo(lx,ly);
  1970.          endFill();
  1971.       }
  1972.       with(this.__mask12)
  1973.       {
  1974.          clear();
  1975.          moveTo(lx,ly);
  1976.          beginFill(0,100);
  1977.          lineTo(bx,by);
  1978.          lineTo(cx,cy);
  1979.          lineTo(dx,dy);
  1980.          lineTo(lx,dy);
  1981.          lineTo(lx,ly);
  1982.          endFill();
  1983.       }
  1984.       with(this.__shMask03)
  1985.       {
  1986.          clear();
  1987.          moveTo(lx,ly);
  1988.          beginFill(16711680,100);
  1989.          lineTo(px,py);
  1990.          lineTo(bx,by);
  1991.          lineTo(lx,ly);
  1992.          endFill();
  1993.       }
  1994.       with(this.__shMask04)
  1995.       {
  1996.          clear();
  1997.          moveTo(lx,ly);
  1998.          beginFill(16711680,100);
  1999.          lineTo(ccx,cy);
  2000.          lineTo(bx,by);
  2001.          lineTo(lx,ly);
  2002.          endFill();
  2003.       }
  2004.       with(this.__pagesShadow)
  2005.       {
  2006.          _rotation = beta * this.radIndex;
  2007.          _xscale = this.__ox <= 0 ? (- r) / 4 : r / 4;
  2008.          ly -= pageH2;
  2009.          by -= pageH2;
  2010.          var bl = Math.sqrt((lx - bx) * (lx - bx) + (ly - by) * (ly - by));
  2011.          _alpha = 2 * pageW - r >= 50 ? 100 : 2 * (2 * pageW - r);
  2012.          _x = by >= ly ? lx - bl / 2 * sin_b : bx - bl / 2 * sin_b;
  2013.          _y = by >= ly ? ly + bl / 2 * cos_b : by + bl / 2 * cos_b;
  2014.       }
  2015.       with(this.__shadow03)
  2016.       {
  2017.          _rotation = this.__pagesShadow._rotation;
  2018.          _xscale = this.__pagesShadow._xscale;
  2019.          _alpha = this.__pagesShadow._alpha;
  2020.          _x = this.__pagesShadow._x;
  2021.          _y = this.__pagesShadow._y;
  2022.       }
  2023.       with(this.__shadow04)
  2024.       {
  2025.          _rotation = this.__pagesShadow._rotation;
  2026.          _xscale = - this.__pagesShadow._xscale;
  2027.          _alpha = this.__pagesShadow._alpha;
  2028.          _x = this.__pagesShadow._x;
  2029.          _y = this.__pagesShadow._y;
  2030.       }
  2031.    }
  2032.    this.__page03.setMask(this.__mask03);
  2033.    this.__shadow03.setMask(this.__shMask03);
  2034.    this.__shadow04.setMask(this.__shMask04);
  2035.    this.__ox <= 0 ? this.__page01.setMask(this.__mask12) : this.__page02.setMask(this.__mask12);
  2036. };
  2037. FFlippingBookView.prototype.directGotoPage = function(n)
  2038. {
  2039.    if(this._bookState != this._const.UNACTIVE_STATE)
  2040.    {
  2041.       return undefined;
  2042.    }
  2043.    this._model._currentPage = this._model._realPageNumber(n);
  2044.    this._cache.restoreDirectGotoPages();
  2045.    this._model.__direction = -1;
  2046.    this._model.putPage();
  2047.    this.__page01.setMask(null);
  2048.    this.__page02.setMask(null);
  2049. };
  2050. FFlippingBookView.prototype.gotoPage = function(n)
  2051. {
  2052.    if(this._bookState != this._const.UNACTIVE_STATE)
  2053.    {
  2054.       return undefined;
  2055.    }
  2056.    this._bookState = this._const.GOTOPAGE_STATE;
  2057.    this.__gotoPageIndex = this._model._realPageNumber(n);
  2058.    if(this._model._currentPage > this.__gotoPageIndex)
  2059.    {
  2060.       this.__page04._x = - this._pageWidth;
  2061.       this.__ox = - this._pageWidth;
  2062.       this.__oy = (- this._pageHeight) / 2;
  2063.    }
  2064.    if(this._model._currentPage < this.__gotoPageIndex)
  2065.    {
  2066.       this.__page04._x = 0;
  2067.       this.__ox = this._pageWidth;
  2068.       this.__oy = (- this._pageHeight) / 2;
  2069.    }
  2070.    this.__oldX = 0;
  2071.    this.__oldY = 0;
  2072.    this._model.getNextGotoPage(this.__gotoPageIndex);
  2073.    if(this._bookState != this._const.UNACTIVE_STATE)
  2074.    {
  2075.       this._flipSound.start(0,1);
  2076.       this.__pagesShadow._visible = true;
  2077.       this.__shadow03._visible = true;
  2078.       this.__shadow04._visible = true;
  2079.       this.__shadow03.setMask(this.__shMask03);
  2080.       this.__shadow04.setMask(this.__shMask04);
  2081.       this.__drawShadow12Mask();
  2082.    }
  2083. };
  2084. Object.registerClass("FFlippingBookSymbol",FFlippingBookClass);
  2085.